/*
 * Created on Oct 22, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.hermeneute.fsa;

/**
 * @author mauceri
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class FSTSequentialTinyCompiledState implements FSTSequentialCompiledState {

	/* (non-Javadoc)
	 * @see com.hermeneute.fst.FSTSerialCompiledState#nextState(char)
	 */
	int idx;
	FSTCompiledTransition ct;
	
	FSTSequentialTinyCompiledState (FSTTransition t,int idx[]){
		this.idx = idx[(int)t.getEvent().getIn()];
		ct = new FSTCompiledTransition (
				t.getState(),t.getEvent().getOut());
	}
	
	public FSTCompiledTransition nextState(int input) {
		// TODO Auto-generated method stub
		if (input == idx){
			return ct;
		}else{
			return null;
		}
	}

	/* (non-Javadoc)
	 * @see com.hermeneute.fst.FSTSequentialCompiledState#getType()
	 */
	public int getType() {
		// TODO Auto-generated method stub
		return FSTSequentialCompiledState.TINY_STATE;
	}

}
